﻿using LY.Entity;
using LY.Entity.Entities;
using LY.Entity.Jsons;
using LY.Entity.PageSearch;
using LY.Entity.SearchEntity;
using LY.Extension;
using LY.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace QJ.CMS.Controllers
{
    public class ChangeController : MyControllerBase
    {
        //
        // GET: /Change/
        private IProjectService _projectService;
        private IArticleService _article;
        public ChangeController(IProjectService projectService, IArticleService articleService)
        {
            _projectService = projectService;
            _article = articleService;
        }
        public ActionResult Index(ProjectSearch search, FormCollection formCollection)
        {

            ///首页数据统计【项目总数，累计注册人数，客户累计投资】
            Change.Index statics = _projectService.GetIndexStatics();
            ViewBag.Statics = statics;


            formCollection.Add("page", search.page ?? "1");
            formCollection.Add("rp", "3");
            formCollection.Add("c.CreateTime", "desc");
            //PageView view = new PageView(formCollection);
            //search.AuditStatus = "210";
            //PagedList<ProjectEx> projectEx = _projectService.QueryHotProject(search, view);
            List<ProjectEx> projectlist = _projectService.QueryHotProject();
            ViewBag.projectlist = projectlist;
            //ViewData.Model = projectlist;

            //新闻JRSQ 前五
            ViewBag.articleList = _article.GetArticleList("jrsq", 5);

            return View();
        }


        public ActionResult Index1(ProjectSearch search, FormCollection formCollection)
        {

            //首页数据统计【项目总数，累计注册人数，客户累计投资】
            Change.Index statics = _projectService.GetIndexStatics();
            ViewBag.Statics = statics; 

            formCollection.Add("page", search.page ?? "1");
            formCollection.Add("rp", "3");
            formCollection.Add("c.CreateTime", "desc");
            //PageView view = new PageView(formCollection);
            //search.AuditStatus = "210";
            //PagedList<ProjectEx> projectEx = _projectService.QueryHotProject(search, view);
            List<ProjectEx> projectlist = _projectService.QueryHotProject();
            ViewBag.projectlist = projectlist;
            //ViewData.Model = projectlist;

            //新闻JRSQ 前五
            ViewBag.articleList = _article.GetArticleList("jrsq", 5);

            return View();
        }


        

    
    }




}
